package com.guqiao.sdk;

import android.widget.Toast;

public class Sdk {
    static {
        System.loadLibrary("native-lib");
    }

    /**
     * c和java普通方法互相调用
     */

    public native String callNativeMethod(String text);

    public void callJavaMethod(String text){
        Toast.makeText(App.Companion.getMContext(), text, Toast.LENGTH_SHORT).show();
    }

    /**
     * c和java静态方法互相调用
     */
    public static native String staticCallNativeMethod(String text);

    public static void callStaticJavaMethod(String text){
        Toast.makeText(App.Companion.getMContext(), "c调用java静态方法--->" + text, Toast.LENGTH_SHORT).show();
    }


    /**
     * c获取和修改java对象的属性值
     */
    public String name = "我是对象修改前的对象字段";
    public native void changeJavaField();

    public static int index = 0;

    public native void changeJavaStaticField();

}
